QuickOPC User's Guide and Reference
Manual Assembly Referencing
Fundamentals > Referencing the Assemblies (.NET) > Manual Assembly Referencing
In This Topic

C#, VB.NET and F#

This functionality is not available under (or the text does not apply to) .NET Standard development platform.

Your application first needs to reference the QuickOPC.NET or QuickOPC-UA assemblies in order to use the functionality contained in them. How this is done depends on the language and tool you are using:

You are then typically presented with an “Add Reference” dialog. The QuickOPC “Classic” and QuickOPC-UA assemblies are listed under its Assemblies (or .NET) tab. Select those that you need (see their descriptions in “Product Parts” chapter), and press OK.

You can easily see all QuickOPC assemblies grouped together (as in the picture above), if you type “opc labs” into the search box. You can also sort the list alphabetically by Component Name, by clicking on the corresponding column header; then, scroll to the proper place in the list.

Notes:

PowerShell

In PowerShell, use the Add-Type cmdlet to make QuickOPC classes available in your PowerShell session. You need to specify a full path to QuickOPC assemblies, and the assembly name that you want to use.

Example: 

# This example shows how to read value of a single node, and display it.

#requires -Version 5.1
using namespace OpcLabs.EasyOpc.UA
using namespace OpcLabs.EasyOpc.UA.OperationModel

# The path below assumes that the current directory is [ProductDir]/Examples-NET/PowerShell/Windows .
Add-Type -Path "../../../Assemblies/net47/OpcLabs.EasyOpcUA.dll"

[UAEndpointDescriptor]$endpointDescriptor =
    "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
# or "http://opcua.demo-this.com:51211/UA/SampleServer" (not in .NET Standard)
# or "https://opcua.demo-this.com:51212/UA/SampleServer/"

# Instantiate the client object.
$client = New-Object EasyUAClient

Write-Host "Obtaining value of a node..."
try {
    $value = $client.ReadValue($endpointDescriptor, "nsu=http://test.org/UA/Data/ ;i=10853")
}
catch [UAException] {
    Write-Host "*** Failure: $($PSItem.Exception.GetBaseException().Message)"
    return
}

# Display results
Write-Host "value: $($value)"

 

See Also

Examples - OPC Unified Architecture